#encoding:utf-8
'''
FileName:controller.py
Creator:王烨
Date:2010.5.23
'''
import google.protobuf.service as service

class Controller(service.RpcController):
    '''指示RPC调用的状态'''
    def __init__(self):
        self.Reset()
        
    def Reset(self):
        '''重置状态'''
        self.__failed = False
        self.__errorType = None
        self.__errorText = None
    
    def Failed(self):
        '''指示调用是否失败'''
        return self.Failed
    
    def SetFaild(self, errorText):
        '''设置失败状态'''
        self.__failed = True
        self.__errorText = errorText
    
    def ErrorText(self):
        '''获得错误描述'''
        return self.__errorText
    
    def StartCancel(self):
        pass
    
    def IsCanceled(self):
        pass
    
    def NotifyOnCancel(self, callback):
        pass